
server {
    listen       80;
    server_name  localhost 192.168.68.147 www.ldz2.net;

    access_log  /var/log/nginx/host.access.log  main;
    error_log   /var/log/nginx/host.error.log  ;
    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }
   

    location /nginx-status {

          stub_status on;
          access_log off;
          allow 127.0.0.1;
          allow 192.168.100.192;
         # deny all;
    }

    location /web {
      index index.html log.html;

      #proxy_pass http://192.168.68.146:80;
     
      proxy_pass http://192.168.68.146:80/;
      #proxy_hide_header Etag;

      #proxy_redirect off;
      proxy_set_header clientip $remote_addr;
      #proxy_set_header X-Real-IP $remote_addr;
      #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      #proxy_connect_timeout 90;
      #proxy_send_timeout 90;
      #proxy_read_timeout 90;
      #proxy_buffer_size 4k;
      #proxy_buffers 4 32k;
      #proxy_busy_buffers_size 64k;
      #proxy_temp_file_write_size 64k;

      proxy_cache proxycache;
      proxy_cache_key $request_uri;
      proxy_cache_valid 200 302 301 1h;
      proxy_cache_valid any 1m;
      #proxy_cache_use_stale error http_502 http_503;
      #proxy_cache_methods GET;


                        
    }

    location /break {
      root /data/nginx;
      index index.html;
      rewrite ^/break/(.*) /test1/$1 break; 
      rewrite ^/test1/(.*) /test2/$1 break; 
      # return 666 "break";
    }

    location /test1  {
      # return 999 "new test1";
      root /data/nginx;
      index index.html;
      
    }

    location = /test2 {
      return 666 "new test3";
	# root /data/nginx;
	# index index.html;
    }


    #location /last {
    #  root /data/nginx;
    #  index index.html;
    #  rewrite ^/last/(.*) /test1/$1 last;

    #}  
   
    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    #location = /50x.html {
    #    root   /usr/share/nginx/html;
    #}

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

